import { createRouter, createWebHistory } from 'vue-router'
import Login from "@/views/login/index.vue";
import Layout from "@/views/layout/index.vue"
import Home from "@/views/home/index.vue"
import SysMenu from "@/views/sysMenu/index.vue"
import SysUser from "@/views/sysUser/index.vue"
import SysDept from "@/views/sysDept/index.vue"
import SysRole from "@/views/sysRole/index.vue"
import TradeGoods from "@/views/tradeGoods/index.vue"
import TradeOrder from "@/views/tradeOrder/index.vue"
import TradeUser from "@/views/tradeUser/index.vue"
import TradeReport from "@/views/tradeReport/index.vue"
import TradeGoodsSimulation from "@/views/tradeGoodsSimulation/index.vue"

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      redirect: "/login",
    },
    {
      path: "/login",
      name: "login",
      component: Login,
    },
    {
      path: "/layout",
      name: "layout",
      component: Layout,
      redirect:"/home",
      children:[
        {
          path: "/home",
          name: "home",
          component: Home,
        },
        {
          path:"/sysMenu",
          name: "sysMenu",
          component: SysMenu
        },
        {
          path:"/sysUser",
          name: "sysUser",
          component: SysUser
        },
        {
          path:"/sysDept",
          name: "sysDept",
          component: SysDept
        },
        {
          path:"/sysRole",
          name: "sysRole",
          component: SysRole
        },
        {
          path:"/tradeGoods",
          name:"tradeGoods",
          component: TradeGoods
        },
        {
          path:"/tradeOrder",
          name:"tradeOrder",
          component: TradeOrder
        },
        {
          path:"/tradeUser",
          name:"tradeUser",
          component: TradeUser
        },
        {
          path:"/tradeReport",
          name:"tradeReport",
          component: TradeReport
        },
        {
          path:"/tradeGoodsSimulation",
          name: "tradeGoodsSimulation",
          component: TradeGoodsSimulation
        }
      ]
    }
  ],
})

export default router
